<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<title></title>
</head>
<body>
	<canvas id="canvas" width="400" height="400" style="border:1px solid #000"></canvas>

</body>
</html>

<script type="text/javascript">
	var canvas =document.getElementById('canvas');
	var context = canvas.getContext('2d');
	context.strokeStyle="#ff0000";

    context.beginPath()
	context.moveTo(0,0);
	context.lineTo(200,200);
	context.stroke();
	context.closePath();


    context.beginPath()
    context.strokeStyle="#0000ff";
    context.lineWidth =6;
    context.lineCap='round'
	context.moveTo(0,400);
	context.lineTo(200,200);
	context.stroke();
	context.closePath();
</script>